package com.ssy.lingxi.platform.template.service.entity.adorn;

import com.ssy.lingxi.platform.template.service.handler.convert.JpaJsonToWebPlatformBOConverter;
import com.ssy.lingxi.platform.template.service.model.bo.WebPlatformBO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * 平台首页模板装修 - DO
 * @author fhj
 * @date 2021/04/20
 * @version 2.0.0
 */
@Data
@Entity
@Table(schema = "public", name = "pt_platform_template_adorn")
public class PlatformTemplateAdorn {

    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="platform_template_adorn_seq")
    @SequenceGenerator(sequenceName="pt_platform_template_adorn_seq", name="platform_template_adorn_seq", allocationSize = 1)
    @ApiModelProperty(value = "ID")
    private Long id;

    @Column(columnDefinition = "int8")
    @ApiModelProperty(value = "模板ID")
    private Long templateId;

    @Convert(converter = JpaJsonToWebPlatformBOConverter.class)
    @Column(columnDefinition = "jsonb")
    @ApiModelProperty(value = "WEB平台首页装修")
    private List<WebPlatformBO> list;

    @Column(columnDefinition = "int8")
    @ApiModelProperty(value = "创建时间")
    private Long createTime = System.currentTimeMillis();
}
